package com.frxuexi.sign

import com.frxuexi.lib_base.http.ApiService
import com.frxuexi.lib_base.mvi.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignViewModel @Inject constructor(val apiService: ApiService):BaseViewModel<SignIntent>(){
    override fun handlerIntent(it: SignIntent) {
        when(it){
            is SignIntent.getSigns->httpRequest(apiService.getSigns(it.uid))
            is SignIntent.sign-> httpRequest(apiService.sign(toBody(it.item)))
            else -> {}
        }
    }
}